Skip to content

gh-104909: Split some more insts into ops#109943

Merged
gvanrossum merged 10 commits intopython:mainfrom
gvanrossum:load-attr-uops
Sep 27, 2023
Merged

gh-104909: Split some more insts into ops#109943
gvanrossum merged 10 commits intopython:mainfrom
gvanrossum:load-attr-uops

Conversation

@gvanrossum
Copy link
Copy Markdown
Member

@gvanrossum gvanrossum commented Sep 27, 2023

I started by adding some code that shows the most deserving non-viable opcodes. Also doubling max trace size again.

I could do this all day, but the stats show there are diminishing returns. Output from python3 Tools/cases_generator/generate_cases.py -v before splitting the top 5:

Read 186 instructions, 46 ops, 207 macros, 12 pseudos, and 14 families from Python/bytecodes.c
The following ops are not viable uops:
      1,906,418,185 LOAD_ATTR_METHOD_WITH_VALUES        (specialization of LOAD_ATTR)
      1,408,928,326 LOAD_ATTR_METHOD_NO_DICT            (specialization of LOAD_ATTR)
      1,359,753,529 LOAD_ATTR_SLOT                      (specialization of LOAD_ATTR)
      1,064,113,118 STORE_ATTR_SLOT                     (specialization of STORE_ATTR)
        981,677,187 STORE_ATTR_INSTANCE_VALUE           (specialization of STORE_ATTR)
        958,283,266 YIELD_VALUE                        
        777,829,833 CALL                                     (unspecialized)
        490,635,610 SEND_GEN                            (specialization of SEND)
        436,706,438 JUMP_FORWARD                       
        430,588,960 EXTENDED_ARG                       
        391,017,977 JUMP_BACKWARD_NO_INTERRUPT         
        351,940,012 LOAD_ATTR_MODULE                    (specialization of LOAD_ATTR)
        347,159,058 LOAD_ATTR_WITH_HINT                 (specialization of LOAD_ATTR)
        308,391,927 FOR_ITER                                 (unspecialized)
        251,204,370 RETURN_GENERATOR                   
        241,313,761 CALL_LIST_APPEND                    (specialization of CALL)
        177,791,632 CALL_PY_WITH_DEFAULTS               (specialization of CALL)
        175,204,354 CALL_KW                            
        163,262,604 FOR_ITER_GEN                        (specialization of FOR_ITER)
        146,454,299 BINARY_SUBSCR_GETITEM               (specialization of BINARY_SUBSCR)
        143,423,491 LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES (specialization of LOAD_ATTR)
        136,661,968 STORE_FAST_LOAD_FAST               
        136,511,856 LOAD_ATTR_CLASS                     (specialization of LOAD_ATTR)
        112,730,831 SEND                                     (unspecialized)
         92,715,546 MAKE_CELL                          
         83,410,408 CALL_FUNCTION_EX                   
         69,188,245 CALL_ALLOC_AND_ENTER_INIT           (specialization of CALL)
         56,944,041 LOAD_ATTR_METHOD_LAZY_DICT          (specialization of LOAD_ATTR)
         52,280,673 LOAD_ATTR_PROPERTY                  (specialization of LOAD_ATTR)
         50,964,787 STORE_ATTR_WITH_HINT                (specialization of STORE_ATTR)
         22,352,640 LOAD_ATTR_NONDESCRIPTOR_NO_DICT     (specialization of LOAD_ATTR)
          8,497,626 RERAISE                            
          6,000,000 END_ASYNC_FOR                      
          5,253,976 BEFORE_WITH                        
          2,897,006 RAISE_VARARGS                      
          2,005,368 IMPORT_FROM                        
          1,968,468 IMPORT_NAME                        
              8,160 BEFORE_ASYNC_WITH                  
              5,907 RESUME                                   (unspecialized)
              1,540 LOAD_SUPER_ATTR                          (unspecialized)
                801 CLEANUP_THROW                      
                    ENTER_EXECUTOR                     
                    LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN   (specialization of LOAD_ATTR)

I took the counts from here (follow the pystats raw link).

  • Curious what's up with LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN? It was the same on the weekly run a week before; the week before that (Sept 10) the file format was different. @brandtbucher any intuition on this?

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants